Recent advances in microprocessor design and component integration have enabled a wide range of devices to offer increasingly complex functionality and “soft” features. Soft features include software applications that enhance and customize the operation of a device. These devices include standard computing devices, such as desktop and laptop computers, portable computing devices, such as personal data assistants, and consumer devices, such as cellular telephones, messaging pagers, gaming consoles, and set top boxes. Most devices now include an operating system to support the soft features and other extensions.
The increased capabilities offered by these software-upgradeable devices have also created certain user expectations. Often, users are not technically savvy and are intolerant of performance compromises occasioned by architectural challenges, such as slow or inconsistent application performance. Similarly, users generally expect to be able to access a host of separate applications, which are implemented at the system level through multitasking. For users, widely available software applications assure a positive experience through consistency and increased exposure across multiple platforms. However, for software developers, engineering software applications for disparate computing platforms entails increased development costs and on-going support and upgrade commitments for each supported architecture.
Managed code platforms provide one solution to software developers seeking to support multiple platforms by presenting a machine-independent and architecture-neutral operating environment. Managed code platforms include programming language compilers and interpreters executed by an operating system as user applications, but which provide virtual runtime environments within which compatible applications can operate. For instance, applications written in the Java™ programming language, when combined with a Java virtual machine™ (JVM™) runtime environment, can operate on heterogeneous computer systems independent of machine-specific environment and configuration settings. (Note that the terms Java™, JVM™ and Java virtual machine™ are trademarks of SUN Microsystems, Inc. of Santa Clara, Calif.). An overview of the Java programming language is described in P. van der Linden, “Just Java,” Ch. 1, Sun Microsystems, Inc. (2d ed. 1997), the disclosure of which is incorporated by reference. JVMs are a critical component to the overall Java operating environment, which can be ported to the full range of computational devices, including memory-constrained consumer devices.
Managed code platforms are generally designed for the monotonic execution of a single application instance. Multiple instances of a managed code platform are executed to simulate multitasking behavior. Such forced concurrency, however, creates several performance problems. First, each instance incurs a startup transient. Executable and startup data must be read from slow persistent storage, which results in slow initial application performance. Similarly, memory is not shared between instances and each additional instance increases the overall memory footprint of the platform by separately loading and instantiating classes, generally problematic in memory-constrained systems. Moreover, data dependencies and deferred initialization of system state can result in non-deterministic execution patterns. Finally, each instance independently determines the relative importance of executing methods and compiles machine code on an ad hoc basis, often causing inconsistent application performance.
Managed code platforms introduce an intermediate layer of interoperability between applications and the underlying system. Through a managed code platform, a compliant managed code application can access system resources and provide functionality analogous to native-mode applications, which operate directly within the system environment. However, for security reasons and due to resource constraints, the control over and access to system resources that is afforded to managed code applications should be managed. One solution, application models, can be used to logically define the management roles and divisions of responsibility between the applications and the system. Application models can specify, for instance, how an application is started or stopped, when the application can access system resources, and how an application discovers initialization parameters, typically through class and data structure definitions.
For efficiency or business reasons, multiple application models can be supported on a single hybrid device. Managed code applications can be executed based on any of the available application models, which provide different operating environments, including application classes, library methods and data structures that can only be shared within the model instance. Application models are implemented through class loaders, which are executed by the runtime system process for each supported application model, to generate cached class instances and data, as well as allow encapsulation and segregation of namespaces. An application is normally started by creating a class loader matching the application model for the application and requesting classes via the class loader instance, which can consumes an increasing amount of processor and memory resources for each subsequently executed application. Moreover, executing individual class loaders for separate application models can be problematic for resource constrained devices, where boot startup time is critical and a combination of slower processor performance and persistent storage access and modest memory sizes can cause significant boot times.
Therefore, there is a need for an approach to providing speculative initialization of warmed-up activities for providing a plurality of application models in a managed code platform, such as the Java operating environment. Preferably, a class loader for each managed class would be instantiated and initialized prior to invocation of classes or data structures defined relative to each application model. There is a further need for an approach to aligning the addresses of instructions of cached code for class instances and data shared between spawned runtime system processes at underlying operating system page boundaries.